home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / comm / tcp / AmiTCPsdk_40.lha / AmiTCP-4.0 / netinclude / netdb.h < prev    next >
C/C++ Source or Header  |  1994-10-03  |  2KB  |  79 lines

  1. #ifndef NETDB_H
  2. #define NETDB_H \
  3.        "$Id: netdb.h,v 4.2 1994/10/03 20:52:20 ppessi Exp $"
  4. /*
  5.  *      Network Database Structures and Defintions
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12.  
  13. #define _PATH_DB            "AmiTCP:db"
  14. #define _PATH_AMITCP_CONFIG "AmiTCP:db/AmiTCP.config"
  15. #define    _PATH_HEQUIV        "AmiTCP:db/hosts.equiv"
  16. #define    _PATH_INETDCONF        "AmiTCP:db/inetd.conf"
  17.  
  18. /*
  19.  * Structures returned by network data base library.  All addresses are
  20.  * supplied in host order, and returned in network order (suitable for
  21.  * use in system calls).
  22.  */
  23. struct    hostent {
  24.     char    *h_name;    /* official name of host */
  25.     char    **h_aliases;    /* alias list */
  26.     int    h_addrtype;    /* host address type */
  27.     int    h_length;    /* length of address */
  28.     char    **h_addr_list;    /* list of addresses from name server */
  29. #define    h_addr    h_addr_list[0]    /* address, for backward compatiblity */
  30. };
  31.  
  32. /*
  33.  * Assumption here is that a network number
  34.  * fits in 32 bits -- probably a poor one.
  35.  */
  36. struct    netent {
  37.     char        *n_name;    /* official name of net */
  38.     char        **n_aliases;    /* alias list */
  39.     int        n_addrtype;    /* net address type */
  40.     unsigned long    n_net;        /* network # */
  41. };
  42.  
  43. struct    servent {
  44.     char    *s_name;    /* official service name */
  45.     char    **s_aliases;    /* alias list */
  46.     int    s_port;        /* port # */
  47.     char    *s_proto;    /* protocol to use */
  48. };
  49.  
  50. struct    protoent {
  51.     char    *p_name;    /* official protocol name */
  52.     char    **p_aliases;    /* alias list */
  53.     int    p_proto;    /* protocol # */
  54. };
  55.  
  56. #ifndef KERNEL
  57.  
  58. #ifndef BSDSOCKET_H
  59. #include <bsdsocket.h>
  60. #endif
  61.  
  62. #endif /* !KERNEL */
  63.  
  64. /*
  65.  * Error return codes from gethostbyname() and gethostbyaddr()
  66.  * (left in extern int h_errno).
  67.  */
  68. #ifndef KERNEL
  69. extern    int h_errno;
  70. #endif
  71.  
  72. #define    HOST_NOT_FOUND    1 /* Authoritative Answer Host not found */
  73. #define    TRY_AGAIN    2 /* Non-Authoritive Host not found, or SERVERFAIL */
  74. #define    NO_RECOVERY    3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
  75. #define    NO_DATA        4 /* Valid name, no data record of requested type */
  76. #define    NO_ADDRESS    NO_DATA        /* no address, look for MX record */
  77.  
  78. #endif /* !NETDB_H */
  79.